package com.java.concurrent;

import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * d
 *
 * @author wwm
 * @create 2017-04-18 15:43
 **/
public class testmain {

    public  static void  main( String[] xargs) throws InterruptedException{
        AtomicInteger ai = new AtomicInteger(0);

        ExecutorService ex1 = Executors.newFixedThreadPool(3);
        ExecutorService ex2 = Executors.newFixedThreadPool(3);

        TestPro testPro = new TestPro(ai);
        TestCustomer testCustomer = new TestCustomer(ai);


        for (int i=0;  i<=100 ;i++){
            ex1.submit(testPro);
            ex2.submit(testCustomer);
            ex1.submit(testPro);
            ex2.submit(testCustomer);
            ex1.submit(testPro);
            ex2.submit(testCustomer);
        }

        ex1.shutdown();
        ex2.shutdown();


    }




}
